﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Server.Search.Administration;

namespace SPDEV.Search.Utilities
{
    public static class SearchContext_Extensions
    {
        public static ManagedProperty GetManagedProperty(this SearchContext searchContext, string name)
        {
            var managedProperty = new Schema(searchContext).AllManagedProperties.Cast<ManagedProperty>().Where(x => x.Name == name).First();
            return managedProperty;
        }
    }
}
